home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM13_A.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  4KB  |  88 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM13_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_handle_pages                                        ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the number of pages allocated to  ;
  7. ;                     a specific EMM handle.                                  ;
  8. ;                                                                             ;
  9. ;           PASSED:   &pages_alloc_to_handle:                                 ;
  10. ;                        is a far pointer to the number of logical pages      ;
  11. ;                        allocated  to the specified EMM handle.              ;
  12. ;                                                                             ;
  13. ;                     handle:                                                 ;
  14. ;                        is an open EMM handle.                               ;
  15. ;                                                                             ;
  16. ;         RETURNED:   status:                                                 ;
  17. ;                        is the status EMM returns from the call.  All other  ;
  18. ;                        returned results are valid only if the status        ;
  19. ;                        returned is zero.  Otherwise they are undefined.     ;
  20. ;                                                                             ;
  21. ;                     pages_alloc_to_handle:                                  ;
  22. ;                        is the number of logical pages allocated to the      ;
  23. ;                        specified EMM handle.  This number never exceeds     ;
  24. ;                        2048 because the memory manager allows a maximum of  ;
  25. ;                        2048 pages (32M bytes) of expanded memory.           ;
  26. ;                                                                             ;
  27. ; C USE CONVENTION:   unsigned int status;                                    ;
  28. ;                     unsigned int pages_alloc_to_handle;                     ;
  29. ;                     unsigned int handle;                                    ;
  30. ;                                                                             ;
  31. ;                     status = get_handle_pages (&pages_alloc_to_handle,      ;
  32. ;                                                handle);                     ;
  33. ;-----------------------------------------------------------------------------;
  34. .XLIST
  35. PAGE    60,132
  36.  
  37. IFDEF SMALL
  38.    .MODEL SMALL, C
  39. ENDIF
  40. IFDEF MEDIUM
  41.    .MODEL MEDIUM, C
  42. ENDIF
  43. IFDEF LARGE
  44.    .MODEL LARGE, C
  45. ENDIF
  46. IFDEF COMPACT
  47.    .MODEL COMPACT, C
  48. ENDIF
  49. IFDEF HUGE
  50.    .MODEL HUGE, C
  51. ENDIF
  52.  
  53. INCLUDE emmlib.equ
  54. INCLUDE emmlib.str
  55. INCLUDE emmlib.mac
  56. .LIST
  57. .CODE
  58.  
  59. get_handle_pages    PROC                                                  \
  60.             ptr_pages_alloc_to_handle:FAR PTR WORD,                   \
  61.             handle:WORD                                           
  62.  
  63.     ;---------------------------------------------------------------------;
  64.     ;   do;                                                               ;
  65.     ;   .   get the number of pages allocated to the handle;              ;
  66.     ;---------------------------------------------------------------------;
  67.     MOVE        AH, get_handle_pages_fcn
  68.     MOVE        DX, handle
  69.     INT         EMM_int
  70.  
  71.     ;---------------------------------------------------------------------;
  72.     ;   .   pass the number of pages allocated to the handle back to      ;
  73.     ;   .   the caller;                                                   ;
  74.     ;---------------------------------------------------------------------;
  75.     MOVE        DX, BX
  76.     MOVE        ES:BX, ptr_pages_alloc_to_handle
  77.     MOVE        ES:[BX], DX
  78.  
  79.     ;---------------------------------------------------------------------;
  80.     ;   .   return (EMM status);                                          ;
  81.     ;   end;                                                              ;
  82.     ;---------------------------------------------------------------------;
  83.     RET_EMM_STAT    AH
  84.  
  85. get_handle_pages    ENDP
  86.  
  87. END
  88.